/*
 * CreateItemType.java
 */

package nxtgeninventorysystem.View.Dialog;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JTextArea;
import nxtgeninventorysystem.View.Gui;

/**
 * The dialog box that displays a field for item type creation.
 * @author Seraph Softworks
 */
public class ErrorOutput extends GuiDialog {

    /** Creates new form DatabaseConfig */
    public ErrorOutput(java.awt.Frame parent) {
        super(parent);
    }

    @Override
    public void resetFields() {
        
    }

    @Override
    protected void initialize() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        javax.swing.JButton closeButton = new javax.swing.JButton();
        javax.swing.JScrollPane textareaScroll = new javax.swing.JScrollPane();
        textarea = new javax.swing.JTextArea();
        javax.swing.JButton clearButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(nxtgeninventorysystem.Driver.class).getContext().getResourceMap(ErrorOutput.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setMinimumSize(new java.awt.Dimension(275, 100));
        setName("Form"); // NOI18N
        setResizable(false);

        closeButton.setAction(new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                dispose();
                Gui.setStatusBarMessage("Ready...");
            }
        });
        closeButton.setText(resourceMap.getString("closeButton.text")); // NOI18N
        closeButton.setName("closeButton"); // NOI18N

        textareaScroll.setName("textareaScroll"); // NOI18N

        textarea.setColumns(20);
        textarea.setFont(resourceMap.getFont("textarea.font")); // NOI18N
        textarea.setRows(5);
        textarea.setWrapStyleWord(true);
        textarea.setEnabled(false);
        textarea.setName("textarea"); // NOI18N
        textareaScroll.setViewportView(textarea);

        clearButton.setAction(new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                clearTextArea();
            }
        });
        clearButton.setText(resourceMap.getString("clearButton.text")); // NOI18N
        clearButton.setName("clearButton"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(textareaScroll, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 391, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(clearButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(closeButton)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(textareaScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(closeButton)
                    .addComponent(clearButton))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextArea textarea;
    // End of variables declaration//GEN-END:variables

    public void clearTextArea() {
        textarea.setText("");
    }

    public JTextArea getTextArea() {
        return textarea;
    }

}
